package com.cy.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cy.entity.Dictionary;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author : 残影
 * @Date: 2021-02-23 15:50
 */
public interface DictionaryMapper extends BaseMapper<Dictionary> {
    /**
     * 根据书本id和章节名称查询词汇
     * @param bookId
     * @param tag
     * @return
     */
    @Select("SELECT dictionary.* FROM book_dictionary ,dictionary " +
            "WHERE book_dictionary.book_id = #{bookId} AND book_dictionary.tag = #{tag} " +
            "AND book_dictionary.dictionary_id = dictionary.id")
    List<Dictionary> getVocabulary(String bookId, String tag);
}
